package com.sesame.user.controller;

import com.sesame.user.service.UserService;
import kim.sesame.common.web.controller.AbstractWebController;
import kim.sesame.common.result.ApiResult;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CommonsLog
@RestController
@RequestMapping("/user")
public class UserController extends AbstractWebController {

    @Autowired
    UserService userService;

    /**
     * http://127.0.0.1:8010/user/list?id=1
     * @param id
     * @return
     */
    @RequestMapping("/list")
    public ApiResult list(String id) {
        return success(userService.searchList(id));
    }

    /**
     * http://127.0.0.1:8010/user/obj?id=1
     * @param id
     * @return
     */
    @RequestMapping("/obj")
    public ApiResult obj(String id) {
        return success(userService.searchObj(id));
    }

}

